<template>
  <div class="reader">
    <div class="max">
      <h3>用户信息</h3>
      <div class="yonghuxinxi">
        <span>用户账号: 1300000</span>
        <span>用户昵称: 测试数据</span>
      </div>
    </div>
    <div class="nb">

      <el-table :data="tableData" height="600" style="width: 80%">
        <el-table-column prop="riqi" label="日期" width="140" />
        <el-table-column prop="shuimianshichang" label="睡眠时长" width="140" />
        <el-table-column prop="shenshuishichang" label="深睡时长" width="140" />
        <el-table-column prop="qianshuishichang" label="浅睡时长" width="140" />
        <el-table-column prop="qingxishichang" label="清晰时长" width="140" />
        <el-table-column prop="zuowan" label="昨晚入睡时间" width="140" />
        <el-table-column prop="jintian" label="今天入睡时间" width="140" />
      </el-table>
    </div>
  </div>
</template>

<script setup>
import { onMounted, ref } from "vue";
import { useRoute } from "vue-router";
const route = useRoute();

let tableData = ref()

onMounted(() => {
  tableData.value = JSON.parse(route.query.id);
  console.log(JSON.parse(route.query.id));
})

</script>

<style lang='scss' scoped>
.max {
  margin-left: 130px;
}
.nb {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.reader {
  width: 100%;
  height: 100%;
  .yonghuxinxi {
    width: 100%;
    height: 50px;
    // background-color: aqua;
    display: flex;
    align-items: center;
    span {
      font-size: 14px;
      color: gray;
      margin-right: 90px;
    }
  }
}
</style>